class Decorator:

    def __init__(self, func):
        self.func = func

    def __call__(self, *args, **kwargs):
        print("这是__call__方法")
        result = self.func(*args, **kwargs)
        print("after 开始")
        return result


@Decorator
def add(a, b):
    return a + b


if __name__ == '__main__':
    print(add(1, 2))
